
<link rel="stylesheet" type="text/css" href="/public/store/webuploader.css">
<ol class="breadcrumb">
    <li><a href="/store">管理</a></li>
    <li><a href="/store/memberLevel">会员管理</a></li>
    <li class="active"><a href="/store/memberLevel">会员卡</a></li>
</ol>

<!-- seat end -->
<div class="row levelbox">
    <div class="level"></div>
    <div class="editlevel none"></div>
</div>

<!--商家logo 部分模板-->
<script type="text/html" id="ylt_tmpl">
    {{if logo}}
    <div class="grid" style="margin:20px;">
        <div style="margin-right:20px;">
            <img src="{{logo}}" width="256" />
            <input type="hidden" value="{{logo}}" name="logo" required errmsg="请上传商家Logo" />
        </div>
        <div id="picker"></div>
    </div>
    {{else}}
    <div class="grid">
        <div style="padding:15px 20px;font-size:14px;" class="gray g-col">
            <input type="hidden" name="logo" required errmsg="请上传商家Logo" />
            请将商家Logo的图片上传至此处(建议上传透明背景logo)
        </div>
        <div id="picker"></div>
    </div>
    {{/if}}
</script>

<!--会员卡编辑 部分模板-->
<script type="text/html" id="card_tmpl">
    <h4>会员卡效果预览：</h4>
    <div class="tybox">
        <div class="membercard cardstyle{{card.card_style_id}}">
            <div class="price">￥{{card.level_money}}</div>
            <div class="card">{{card.level_name}}</div>
            <div class="cardsign" style="background-image:url({{card.logo}});"></div>
            <img src="{{card.stylePicture}}" class="img-responsive" alt="{{card.level_name}}" />
        </div>
    </div>
    <p class="red">注：右边选择会员卡样式</p>
    <input type="hidden" name="cardStyleId" required errmsg="请选择会员卡样式" value="{{card.card_style_id}}" />
</script>

<!--编辑会员卡 页面主体模板-->
<script type="text/html" id="editlevel_tmpl">
    <div class="panel panel-table">
        <table class="table table-bordered from_table">
            <tr>
                <td class="input_title required" width="140">会员卡名称</td>
                <td>
                    <input type="text" class="form-control" placeholder="请在此输入会员卡名称" name="levelName" value="{{card.level_name}}" required errmsg="请输入请输入会员卡名称" />
                    <input type="hidden" name="id" value="{{card.id}}" />
                </td>
            </tr>
            <tr>
                <td class="input_title required" width="140">会员卡额度</td>
                <td>
                    <input type="text" class="form-control" placeholder="请在此输入会员卡额度" name="levelMoney" value="{{card.levelMoneyStr}}" required errmsg="请输入会员卡额度" />
                </td>
            </tr>
            <tr>
                <td class="input_title required" width="140">赠送金额</td>
                <td>
                    <input type="text" class="form-control" placeholder="请在此输入第一次充值赠送金额" name="levelGiftmoney" value="{{card.levelGiftMoneyStr}}" required errmsg="请输入第一次赠送金额" />
                </td>
            </tr>
            <tr>
                <td class="input_title required">商家Logo</td>
                <td style="padding:0;" id="yulantu"></td>
            </tr>
            <tr>
                <td colspan="2" style="padding:12px 48px;">
                    <div class="grid">
                        <div class="g-col" id="card"></div>
                        <div style="width:360px;padding-top:10px">
                            <div class="panel">
                                <div class="text-center" style="background:#7fb2ff;padding:12px;color:#FFF;">会员卡样式选择</div>
                                <div class="styles">
                                {{each levelStyleList as vo i}}
                                    <p class="hand {{if card.card_style_id==vo.id}}active{{/if}}" data-id="{{vo.id}}">
                                        <img class="img-responsive" src="{{vo.stylePicture}}">
                                    </p>
                                {{/each}}
                                </div>
                            </div>
                        </div>
                    </div>
                </td>
            </tr>
            <tr>
                <td class="input_title required" valign="top">特权描述</td>
                <td>
                    <textarea class="form-control" rows="6" required errmsg="请输入会员特权描述" name="privilege" placeholder="请在此输入会员卡特权，如&#13;&#10;1、到店私人领地&#13;&#10;2、专属私人餐具&#13;&#10;3、全自动按摩椅">{{#card.privilege}}</textarea>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <div class="text-center" style="padding:2em;">
                        <button type="button" class="btn gn_btn from_submit">保存会员卡</button>
                    </div>
                </td>
            </tr>
        </table>
        
    </div>
</script>

<!--充值设置 弹框模板-->
<script type="text/html" id="chongzhi_tmpl">
    <div class="text-right" style="padding-bottom:10px;">
        <div class="btn gn_btn addtr">添加充值赠送事件</div>
    </div>
    <table class="table table-striped" id="ranktr">
        <tr>
            <th nowrap>会员等级</th>
            <th nowrap>充值金额（元）</th>
            <th nowrap>赠送金额（元）</th>
            <th nowrap>操作</th>
        </tr>
        {{each levelProductList as vo i}}
        <tr class="tr">
            <td class="text-center" nowrap style="vertical-align:middle">
                <input type="hidden" name="id" class="form-control" value="{{vo.id}}" /> 
                {{card.level_name}}
            </td>
            <td class="text-center" nowrap>
                <input type="number" name="recharge" placeholder="请填写充值金额" min="0" value="{{vo.recharge}}" class="form-control" required errmsg="请填写充值金额">
            </td>
            <td class="text-center" nowrap>
                <input type="number" name="gift" placeholder="请填写赠送金额" min="0" value="{{vo.gift}}" class="form-control" required errmsg="请填写赠送金额">
            </td>
            <td class="text-center" nowrap style="vertical-align:middle">
                <span class="blue hand dellist" data-id="{{vo.id}}">删除</span>
            </td>
        </tr>
        {{/each}}
    </table>
</script>

<!--充值设置 添加充值时该模块将会被添加到弹框主体中-->
<script type="text/html" id="tr_tmpl">
    <tr class="tr">
        <td class="text-center" nowrap style="vertical-align:middle">
            <input type="hidden" name="id" class="form-control" value="" />
            {{card.level_name}}
        </td>
        <td class="text-center" nowrap>
            <input type="number" name="recharge" placeholder="请填写充值金额" min="0" value="" class="form-control" required errmsg="请填写充值金额">
        </td>
        <td class="text-center" nowrap>
            <input type="number" name="gift" placeholder="请填写赠送金额" min="0" value="" class="form-control" required errmsg="请填写赠送金额">
        </td>
        <td class="text-center" nowrap style="vertical-align:middle">
            <span class="blue hand dellist">删除</span>
        </td>
    </tr>
</script>

<!--会员卡列表功能 主界面模板-->
<script type="text/html" id="level_tmpl">
    <div class="grid container-fluid fromhead middle">
        <div class="g-col">您当前已设置了 {{levelList.length}} 种会员卡</div>
        <div>
            {{if levelList.length==0}}
            <button type="button" class="btn gn_btn edit">添加新会员卡</button>
            {{/if}}
        </div>
    </div>
    <div class="container-fluid">
        <div class="panel panel-table">
            <table class="table table-bordered from_table">
                <tr>
                    <th class="text-center" nowrap>会员卡名称</th>
                    <th nowrap>
                        额度设置
                        <span style="font-size:14px;color:#ee5050;margin-left:1em;">会员卡充值门槛（元）</span>
                    </th>
                    <th nowrap>赠送金额<span style="font-size:14px;color:#ee5050;margin-left:1em;">第一次充值赠送（元）</span></th>
                    <th class="text-center" nowrap>充值设置</th>
                    <th class="text-center" nowrap>操作</th>
                </tr>
                {{each levelList as vo i}}
                <tr>
                    <td class="text-center">
                        {{vo.level_name}}
                    </td>
                    <td>
                        ￥{{vo.levelMoneyStr}}
                    </td>
                    <td>
                        ￥{{vo.levelGiftMoneyStr}}
                    </td>
                    <td class="text-center blue hand chongzhi" data-i="{{i}}">
                        充值设置
                    </td>
                    <td class="text-center" nowrap>
                        <span class="edit blue hand" data-i="{{i}}">编辑</span>
                        <span class="del red hand" data-i="{{i}}">删除</span>
                    </td>
                </tr>
                {{/each}}
            </table>
        </div>
    </div>
</script>


<script src="/public/store/webuploader.js"></script>
